#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a, b, c;
	int arr[100] = { 0 };
	int arr1[100] = { 0 };
	printf("   1\n");
	arr[1] = 1;
	arr[0] = 1;
	for (a = 1; a < 10; a++)
	{
		for (b = 0; b < a+1; b++)
		{
			printf("%4d", arr[b]);
		}
		printf("\n");
		arr1[0] = arr[0];
		for (b = 1; b <= a; b++)
		{
			arr1[b] = arr[b - 1] + arr[b];
		}
		arr1[a + 1] = arr[a];
		for (b = 0; b <= a+1; b++)
		{
			arr[b] = arr1[b];
		}

	}
	return 0;
}